const path = require('path');

module.exports = {
  mode: 'production',
  // mode: 'development',
  entry: './index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'chart.min.js'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader: 'babel-loader',
          options: {
            "presets": [
              [
                "@babel/env"
              ]
            ],
            "plugins": [
              "@babel/plugin-transform-arrow-functions",
              "@babel/plugin-transform-classes",
              "@babel/plugin-transform-block-scoping"
            ]
          }
        },
        exclude: '/node_module/'
      }
    ]
  }
};
